//
//  Model.m
//  UI10-易车
//
//  Created by 韩旭 on 16/7/27.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "Model.h"

@implementation Model

- (instancetype)initWithDic:(NSDictionary *)dic {
    self = [super init];
    if (self) {
        self.picCover = dic[@"picCover"];
        self.title = dic[@"title"];
    }
    return self;
}
+ (instancetype)modelWithDic:(NSDictionary *)dic {
    return [[Model alloc] initWithDic:dic];
}
+ (NSArray *)arrGroup {
    NSString *path = [[NSBundle mainBundle] pathForResource:@"YiChe" ofType:@"plist"];
    NSDictionary *dic = [NSDictionary dictionaryWithContentsOfFile:path];
        NSDictionary *data = dic[@"data"];
    NSArray *arrList = data[@"list"];
    NSArray *arrCycleImage = data[@"cycleImage"];
    NSMutableArray *arrAll = [NSMutableArray array];
    Model *model = [[Model alloc] init];
    model.arrCycleImage = [NSMutableArray array];
    model.arrayList = [NSMutableArray array];
    for (NSDictionary *dicList in arrList) {
      [model.arrayList addObject:[Model modelWithDic:dicList]];
    }
    for (NSDictionary *dicCycle in arrCycleImage) {
        [model.arrCycleImage addObject:[Model modelWithDic:dicCycle]];
    }
    [arrAll addObject:model];
     return arrAll;
}
@end